package com.example.shop_front_api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.persistence.Id;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@TableName("shop_goods")
@Document(indexName = "es_goods_list")
public class Goods {

    @Id
    @TableId(type = IdType.AUTO)
    private Long id;

    @JsonProperty("goods_name")
    @Field(name = "goods_name", type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String goodsName;

    @JsonProperty("first_cate_id")
    @Field(name = "first_cate_id", type = FieldType.Integer)
    private int firstCateId;

    @JsonProperty("second_cate_id")
    @Field(name = "second_cate_id", type = FieldType.Integer)
    private int secondCateId;

    @JsonProperty("third_cate_id")
    @Field(name = "third_cate_id", type = FieldType.Integer)
    private int thirdCateId;

    @JsonProperty("sale_price")
    @Field(name = "sale_price", type = FieldType.Double)
    private double salePrice;

    @JsonProperty("sales_number")
    @Field(name = "sales_number", type = FieldType.Integer)
    private int salesNumber;

    @JsonProperty("status")
    private int status;

    @JsonProperty("main_image")
    @Field(name = "main_image", type = FieldType.Text)
    private String mainImage;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public int getFirstCateId() {
        return firstCateId;
    }

    public void setFirstCateId(int firstCateId) {
        this.firstCateId = firstCateId;
    }

    public int getSecondCateId() {
        return secondCateId;
    }

    public void setSecondCateId(int secondCateId) {
        this.secondCateId = secondCateId;
    }

    public int getThirdCateId() {
        return thirdCateId;
    }

    public void setThirdCateId(int thirdCateId) {
        this.thirdCateId = thirdCateId;
    }

    public double getSalePrice() {
        return salePrice;
    }

    public void setSalePrice(double salePrice) {
        this.salePrice = salePrice;
    }

    public int getSalesNumber() {
        return salesNumber;
    }

    public void setSalesNumber(int salesNumber) {
        this.salesNumber = salesNumber;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMainImage() {
        return mainImage;
    }

    public void setMainImage(String mainImage) {
        this.mainImage = mainImage;
    }

    
}